/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#include "构建视频图像节点.h"

#include <Context/节点数据操作.h>
#include <节点/socket_utils.h>




#include <libavcodec/avcodec.h>   
#include <libavutil/mathematics.h>   
#include <libavformat/avformat.h>   
#include <libswscale/swscale.h>   
//#include <libavdevice/avdevice.h>  



#include "节点/网络/UDP.h"
#include "节点/材质/纹理节点.h"
#include "节点/材质/材质节点.h"
#include "节点/插座/字符插座.h"


#include "框架/操作环境管理.h"
#include "框架/工作区/ui属性栏.h"






void f_Operator初始化跟踪点(S_结构对象指针 ops) {
	C_节点面板* node = (C_节点面板*)ops;

	C_流视频节点* 流视频节点 = dynamic_cast<C_流视频节点*>(node->m_NodeData);

	if (流视频节点) {
		//流视频节点->f_init跟踪器坐标();
	}
}

static void on_节点参数更新(S_Props& prop) {
	auto nodes = f_global_get激活节点();
	for (auto 节点 : nodes) {
		节点->f_set是否要更新(true);

		f_render_刷新渲染(f_NodeCtx_get默认场景());
	}
}

static void on_节点参数更新_重新编译(S_Props& prop) {
	auto nodes = f_global_get激活节点();
	for (auto 节点 : nodes) {
		节点->f_更新上层节点(true);
		//f_render_刷新渲染(f_NodeCtx_get默认场景());
	}
}

static void on_节点参数更新_重新加载着色器(S_Props& prop) {
	auto nodes = f_global_get激活节点();
	for (auto 节点 : nodes) {
		节点->f_set是否要更新(true);
		C_PBR材着色器节点* shaderNode = static_cast<C_PBR材着色器节点*>(节点);
		auto* t = 节点->f_get子集树();
		int32 id = f_NE_get着色器节点树ID(t);
		if (id > 0) {
			f_scene_添加光追材质着色器(S_框架::g_Scene, f_WStringToString(f_prop_Str(t->m_代码文件路径)), id);
		}
	}
}

static void on_节点参数更新_重新加载纹理(S_Props& prop) {
	auto nodes = f_global_get激活节点();
	for (auto 节点 : nodes) {
		节点->f_set是否要更新(true);
		C_外部纹理节点* testureNode = static_cast<C_外部纹理节点*>(节点);
		if (prop.m_值元素个数) {
			auto* socket1 = testureNode->f_get输入插座(1);
			auto* path = DEF_路径插座数据(socket1, 0);

			f_tex_从文件填充纹理(testureNode->m_Tex, path->string(), f_NodeCtx_get默认场景()->m_光追后端->m_渲染命令缓存);
			f_scene_重载渲染器绑定纹理(f_NodeCtx_get默认场景(), testureNode->m_Tex);
		}
		else {
			f_ui_set路径编辑框对话框类型(prop.m_UI->m_部件, E_对话框类型::e_读取);
			f_ui_set路径编辑框对话框后缀(prop.m_UI->m_部件, ".png");
		}
		
	}
}

static void on_节点参数更新_重新加载纹理集(S_Props& prop) {
	auto nodes = f_global_get激活节点();
	for (auto 节点 : nodes) {
		节点->f_set是否要更新(true);
		f_ui_set路径编辑框对话框类型(prop.m_UI->m_部件, E_对话框类型::e_打开路径);
	}
}


static void on_节点参数更新_重新加载字体(S_Props& prop) {
	auto nodes = f_global_get激活节点();
	for (auto 节点 : nodes) {
		节点->f_set是否要更新(true);
		f_ui_set路径编辑框对话框类型(prop.m_UI->m_部件, E_对话框类型::e_读取);
		f_ui_set路径编辑框对话框后缀(prop.m_UI->m_部件, ".ttf");
	}
}






static void on_噪波节点参数更新(S_Props& prop) {
	auto nodes = f_global_get激活节点();
	for (auto 节点 : nodes) {
		节点->f_set是否要更新(true);
		C_噪波纹理节点* testureNode = static_cast<C_噪波纹理节点*>(节点);

		testureNode->m_过程纹理属性.m_UI->m_部件->m_绘制属性更新 = true;
	}
}





static void on_材质节点树列表_项改变(S_Props& prop, S_MapPtr& ptrItem, int32 操作类型) {
	auto& nodes = f_global_get激活节点();
	if (nodes.empty()) return;

	C_材质节点* node = dynamic_cast<C_材质节点*>(nodes.front());

	switch (操作类型) {
	case E_Prop_MapPtr_项事件类型::e_项删除: {
		C_节点树* tree = f_NT_拷贝(node->f_get子集树());
		f_prop_MatPtr_切换ID(node->m_材质节点树, tree);

		node->f_解绑定子集节点树();
		node->f_绑定子集节点树(tree);
		break;
	}

	case E_Prop_MapPtr_项事件类型::e_项名称改变: {
		auto& e = ptrItem.m_PtrItem[ptrItem.m_当前项];
		((C_节点树*)e.m_Ptr)->G节点名称分配.f_Move(e.m_Str);
		e.m_Str = ((C_节点树*)e.m_Ptr)->G节点名称分配.f_Gen(e.m_Str);
		break;
	}

	case E_Prop_MapPtr_项事件类型::e_项添加: {
		C_节点树* tree = f_node_Create材质节点树(false, L"材质");
		auto* inNode = new C_输入组节点(node->m_Ctx);
		auto* outNode = new C_输出组节点(node->m_Ctx);
		f_su_拷贝插座(node, inNode, E_插座方向::e_插座Type_输入, E_插座方向::e_插座Type_输出);
		C_着色器插座* socket = new C_着色器插座(L"着色器");
		outNode->f_add插座(socket, E_插座方向::e_插座Type_输入);

		inNode->m_插座可编辑 = true;
		tree->f_添加节点(inNode);
		tree->f_添加节点(outNode);

		f_prop_MatPtr_切换ID(node->m_材质节点树, tree);
		
		node->f_解绑定子集节点树();
		node->f_绑定子集节点树(tree);
		break;
	}

	default: {
		uint32 offset = ptrItem.m_当前项;
		S_MapPtrItem& item = ptrItem.m_PtrItem[offset];

		node->f_解绑定子集节点树();
		node->f_绑定子集节点树((C_节点树*)item.m_Ptr);
		break;
	}
	}
}




static void on_字符纹理列表_项改变(S_Props& prop, S_MapPtr& ptrItem, int32 操作类型) {
	auto& nodes = f_global_get激活节点();
	if (nodes.empty()) return;

	C_材质节点* node = dynamic_cast<C_材质节点*>(nodes.front());

	switch (操作类型) {
		case E_Prop_MapPtr_项事件类型::e_项删除: {
			
			break;
		}

		case E_Prop_MapPtr_项事件类型::e_项名称改变: {
			
			break;
		}

		case E_Prop_MapPtr_项事件类型::e_项添加: {
			
			break;
		}

		default: {
			uint32 offset = ptrItem.m_当前项;
			S_MapPtrItem& item = ptrItem.m_PtrItem[offset];

			break;
		}
	}
}



static void on_着色器节点树列表_项改变(S_Props& prop, S_MapPtr& ptrItem, int32 操作类型) {
	auto& nodes = f_global_get激活节点();
	if (nodes.empty()) return;

	C_着色器节点* node = dynamic_cast<C_着色器节点*>(nodes.front());

	switch (操作类型) {
	case E_Prop_MapPtr_项事件类型::e_项删除: {
		C_节点树* tree = f_NT_拷贝(node->f_get子集树());
		f_prop_MatPtr_切换ID(node->m_节点树, tree);

		node->f_解绑定子集节点树();
		node->f_绑定子集节点树(tree);
		break;
	}

	case E_Prop_MapPtr_项事件类型::e_项名称改变: {
		auto& e = ptrItem.m_PtrItem[ptrItem.m_当前项];
		((C_节点树*)e.m_Ptr)->G节点名称分配.f_Move(e.m_Str);
		e.m_Str = ((C_节点树*)e.m_Ptr)->G节点名称分配.f_Gen(e.m_Str);
		break;
	}

	case E_Prop_MapPtr_项事件类型::e_项添加: {
		C_节点树* tree = f_node_Create着色节点树(false);
		f_prop_MatPtr_切换ID(node->m_节点树, tree);

		node->f_解绑定子集节点树();
		node->f_绑定子集节点树(tree);
		break;
	}

	default: {
		uint32 offset = ptrItem.m_当前项;
		S_MapPtrItem& item = ptrItem.m_PtrItem[offset];

		node->f_解绑定子集节点树();
		node->f_绑定子集节点树((C_节点树*)item.m_Ptr);
		break;
	}
	}
}




static void on_纹理列表_项改变(S_Props& prop, S_MapPtr& ptrItem, int32 操作类型) {
	auto& nodes = f_global_get激活节点();
	if (nodes.empty()) return;

	C_纹理节点* node = dynamic_cast<C_纹理节点*>(nodes.front());

	switch (操作类型) {
	case E_Prop_MapPtr_项事件类型::e_项删除: {
		//C_节点树* tree = f_NT_拷贝(node->f_get子集树());
		//f_prop_MatPtr_切换ID(node->m_纹理库, tree);

		//node->f_解绑定子集节点树();
		//node->f_绑定子集节点树(tree);
		break;
	}

	case E_Prop_MapPtr_项事件类型::e_项名称改变: {
		auto& e = ptrItem.m_PtrItem[ptrItem.m_当前项];
		((S_纹理*)e.m_Ptr);
		e.m_Str = ((S_纹理*)e.m_Ptr)->m_Name;
		break;
	}

	case E_Prop_MapPtr_项事件类型::e_项添加: {
		//C_节点树* tree = f_node_Create着色节点树(false);
		//f_prop_MatPtr_切换ID(node->m_纹理库, tree);

		//node->f_解绑定子集节点树();
		//node->f_绑定子集节点树(tree);
		break;
	}

	default: {
		uint32 offset = ptrItem.m_当前项;
		S_MapPtrItem& item = ptrItem.m_PtrItem[offset];

		//node->f_解绑定子集节点树();
		//node->f_绑定子集节点树((C_节点树*)item.m_Ptr);
		break;
	}
	}
}




static void on_PBR着色器节点树列表_项改变(S_Props& prop, S_MapPtr& ptrItem, int32 操作类型) {
	auto& nodes = f_global_get激活节点();
	if (nodes.empty()) return;

	C_PBR材着色器节点* node = dynamic_cast<C_PBR材着色器节点*>(nodes.front());

	switch (操作类型) {
	case E_Prop_MapPtr_项事件类型::e_项删除: {
		C_节点树* tree = f_NT_拷贝(node->f_get子集树());
		f_prop_MatPtr_切换ID(node->m_节点树, tree);

		node->f_解绑定子集节点树();
		node->f_绑定子集节点树(tree);
		break;
	}

	case E_Prop_MapPtr_项事件类型::e_项名称改变: {
		auto& e = ptrItem.m_PtrItem[ptrItem.m_当前项];
		((C_节点树*)e.m_Ptr)->G节点名称分配.f_Move(e.m_Str);
		e.m_Str = ((C_节点树*)e.m_Ptr)->G节点名称分配.f_Gen(e.m_Str);
		break;
	}

	case E_Prop_MapPtr_项事件类型::e_项添加: {
		C_节点树* tree = f_node_Create着色节点树(false);
		f_prop_MatPtr_切换ID(node->m_节点树, tree);

		node->f_解绑定子集节点树();
		node->f_绑定子集节点树(tree);
		break;
	}

	default: {
		uint32 offset = ptrItem.m_当前项;
		S_MapPtrItem& item = ptrItem.m_PtrItem[offset];

		node->f_解绑定子集节点树();
		node->f_绑定子集节点树((C_节点树*)item.m_Ptr);
		break;
	}
	}
}






static void f_接收UDP图像节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_UDP接收图像节点* node = dynamic_cast<C_UDP接收图像节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;

	panel->f_构建属性部件(props);
}


static void f_流视频节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	//S_Props	prop = f_alloc_OpsProp(f_Operator初始化跟踪点, obj);
	//panel->m_属性.push_back(prop);
	f_区管理_设置当前操作视频(((C_节点面板*)obj)->m_NodeData);
}





C_节点面板* f_节点构建_视频(S_UI创建环境& ctx, C_节点基类* node) {
	//av_register_all();
	//avdevice_register_all();


	char* filename = "/dev/video0";
	char* outfilename = "./testmp4.mp4";

	AVFormatContext* pFormatCtxDec = 0, * pFormatCtxEnc;
	AVCodecContext* pCodecCtxDec, * pCodecCtxEnc;
	AVCodec* pCodecDec, * pCodecEnc;
	AVFrame* pFrameDec, * pFrameEnc;
	AVOutputFormat* pOutputFormat;
	AVStream* video_st;
	//AVFormatParameters inputFmtParameter;

	int i, videoStream;
	int outbuf_size;
	uint8_t* outbuf;
	//AVPacket packet *pktt = &packet;   
	//AVPacket packet;   
	int frameFinished, frames = 0;
	int out_size;


	//AVFormatContext* pFmtCtx = avformat_alloc_context();
	//AVInputFormat* inputFmt = av_find_input_format("video4linux2");

	//C_纹理节点* node = new C_纹理节点(ctx.m_Ctx);
	if(!node) node = new C_流视频节点(ctx.m_Ctx);

	C_节点面板* nodepanel = f_节点创建_UI面板构建(ctx, node, E_节点区类型::e_节点区_图像);
	//nodepanel->mf_鼠标按键点击		= f_nodepanel鼠标单击;
	nodepanel->m_ICO				= "image";
	nodepanel->m_属性面板参数构建	= f_流视频节点_部件构建属性;

	f_区管理_设置当前操作视频(node);

	return nodepanel;
}
















C_节点面板* f_节点构建_接收UDP图像(S_UI创建环境& ctx, C_节点基类* node) {
	if (!node) node = new C_UDP接收图像节点();

	C_节点面板* nodepanel = f_节点创建_UI面板构建(ctx, node, E_节点区类型::e_节点区_图像);
	nodepanel->m_属性面板参数构建 = f_接收UDP图像节点_部件构建属性;
	nodepanel->m_ICO = "global";

	return nodepanel;
}









void f_节点重置_视频(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_图像);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_图像);

	panel->m_属性面板参数构建 = f_流视频节点_部件构建属性;
	panel->m_ICO = "image";
}

void f_节点重置_接收UDP图像(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_图像);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_图像);

	panel->m_属性面板参数构建 = f_接收UDP图像节点_部件构建属性;
	panel->m_ICO = "global";
}



static void f_材质槽节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_材质槽节点* 网格节点 = dynamic_cast<C_材质槽节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_材质槽(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_材质槽节点(ctx_3d);
		node->m_ICO = "ico_材质0001";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_材质槽(panel, node);
	return panel;
}

void f_节点重置_材质槽(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板插座重构(panel, node, E_节点区类型::e_节点区_物体);
	panel->m_属性面板参数构建 = f_材质槽节点_部件构建属性;
	panel->m_ICO = node->m_ICO;
}






static void f_材质节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_材质节点* 节点 = dynamic_cast<C_材质节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	

	auto* t = 节点->f_get子集树();
	t->m_外部加载.m_UI->m_Update = on_节点参数更新;
	props.push_back(t->m_外部加载);

	if (f_prop_Bool(t->m_外部加载)) {
		t->m_代码文件路径.m_UI->m_Update = on_节点参数更新;
		props.push_back(t->m_代码文件路径);
	}
	t->m_函数名称.m_UI->m_Update = on_节点参数更新;
	props.push_back(t->m_函数名称);


	auto& p = f_prop_MapPrt(节点->m_材质节点树);
	p.mf_元素变更 = on_材质节点树列表_项改变;


	props.push_back(节点->m_材质节点树);
	节点->m_灯光标志位.m_UI->m_Update = on_节点参数更新;
	props.push_back(节点->m_灯光标志位);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_材质(S_UI创建环境& ctx, S_设备环境& dev_ctx, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_材质节点(*S_框架::g_3D视口环境, tree);
		node->m_ICO = "ico_材质编辑0000";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_材质(panel, node);

	if (!tree) {
		panel->m_同子集节点树关联UI部件 = new std::set<C_Widget*>();
		(*panel->m_同子集节点树关联UI部件).insert(panel);
	}
	return panel;
}

void f_节点重置_材质(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板插座重构(panel, node, E_节点区类型::e_节点区_物体);

	panel->m_属性面板参数构建 = f_材质节点_部件构建属性;
	panel->m_ICO = node->m_ICO;
}




static void f_当前材质节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_当前材质节点* 节点 = dynamic_cast<C_当前材质节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_当前材质(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_当前材质节点(ctx_3d);
		node->m_ICO = "ico_材质0001";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_当前材质(panel, node);
	return panel;
}

void f_节点重置_当前材质(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板插座重构(panel, node, E_节点区类型::e_节点区_物体);
	panel->m_属性面板参数构建 = f_当前材质节点_部件构建属性;
	panel->m_ICO = node->m_ICO;
}





static void f_着色器节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_着色器节点* 着色器节点 = dynamic_cast<C_着色器节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	auto* t = 着色器节点->f_get子集树();
	t->m_外部加载.m_UI->m_Update = on_节点参数更新;
	props.push_back(t->m_外部加载);

	if (f_prop_Bool(t->m_外部加载)) {
		t->m_代码文件路径.m_UI->m_Update = on_节点参数更新;
		props.push_back(t->m_代码文件路径);
	}

	auto& p = f_prop_MapPrt(着色器节点->m_节点树);
	p.mf_元素变更 = on_着色器节点树列表_项改变;

	props.push_back(着色器节点->m_节点树);
	props.push_back(着色器节点->f_get子集树()->m_函数名称);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_着色器(S_UI创建环境& ctx, S_设备环境& dev_ctx, C_节点基类* node, C_节点树* tree) {
	if (!node) node = new C_着色器节点(*S_框架::g_3D视口环境, tree);
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_着色器(panel, node);

	if (!tree) {
		panel->m_同子集节点树关联UI部件 = new std::set<C_Widget*>();
		(*panel->m_同子集节点树关联UI部件).insert(panel);
	}

	return panel;
}

void f_节点重置_着色器(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_物体);

	panel->m_属性面板参数构建 = f_着色器节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = "ico平面网格0016";
}




static void f_自发光材质节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_自发光材质节点* 网格节点 = dynamic_cast<C_自发光材质节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_自发光材质(S_UI创建环境& ctx, S_设备环境& dev_ctx, C_节点基类* node, C_节点树* tree) {
	if (!node) node = new C_自发光材质节点(*S_框架::g_3D视口环境);
	//if (panel == nullptr) {
	//	panel = f_节点创建_UI面板构建(ctx, node, E_节点区类型::e_节点区_物体);
	//}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_自发光材质(panel, node);

	return panel;
}


void f_节点重置_自发光材质(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_物体);

	panel->m_属性面板参数构建 = f_自发光材质节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = "ico平面网格0016";
}




static void f_纹理节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_纹理节点* 节点 = dynamic_cast<C_纹理节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	auto& p = f_prop_MapPrt(节点->m_纹理库);
	p.mf_元素变更 = on_纹理列表_项改变;
	props.push_back(节点->m_纹理库);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_纹理(S_UI创建环境& ctx, S_设备环境& dev_ctx, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_纹理节点(*S_框架::g_3D视口环境);
		node->m_ICO = "ico平面网格0016";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_图像);
	f_节点重置_纹理(panel, node);
	return panel;
}

void f_节点重置_纹理(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板插座重构(panel, node, E_节点区类型::e_节点区_图像);
	panel->m_属性面板参数构建 = f_纹理节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = node->m_ICO;
}




static void f_外部纹理节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_外部纹理节点* 外部纹理节点 = dynamic_cast<C_外部纹理节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	auto* socket1 = 外部纹理节点->f_get输入插座(1);
	((C_路径插座*)socket1)->m_Value.m_UI->m_Update = on_节点参数更新_重新加载纹理;


	外部纹理节点->m_序列.m_UI->m_Update = on_节点参数更新;
	props.push_back(外部纹理节点->m_序列);

	外部纹理节点->m_序列偏移.m_UI->m_Update = on_节点参数更新;
	props.push_back(外部纹理节点->m_序列偏移);

	外部纹理节点->m_投影方式.m_UI->m_Update = on_节点参数更新;
	props.push_back(外部纹理节点->m_投影方式);

	//props.push_back(外部纹理节点->m_纹理库);
	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_外部纹理(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) node = new C_外部纹理节点(*S_框架::g_3D视口环境);
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_外部纹理(panel, node);
	return panel;
}

void f_节点重置_外部纹理(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板插座重构(panel, node, E_节点区类型::e_节点区_物体);
	panel->m_属性面板参数构建 = f_外部纹理节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = "ico平面网格0016";
}





static void f_外部纹理集节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_外部纹理集节点* 外部纹理节点 = dynamic_cast<C_外部纹理集节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	auto* socket1 = 外部纹理节点->f_get输入插座(1);
	((C_路径插座*)socket1)->m_Value.m_UI->m_Update = on_节点参数更新_重新加载纹理集;


	外部纹理节点->m_全部加载.m_UI->m_Update = on_节点参数更新;
	props.push_back(外部纹理节点->m_全部加载);

	//外部纹理节点->m_过滤名称.m_UI->m_Update = on_节点参数更新;
	//props.push_back(外部纹理节点->m_过滤名称);
	//
	//外部纹理节点->m_投影方式.m_UI->m_Update = on_节点参数更新;
	//props.push_back(外部纹理节点->m_投影方式);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_外部纹理集(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_外部纹理集节点(*S_框架::g_3D视口环境);
		node->m_ICO = "ico平面网格0016";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_外部纹理集(panel, node);
	return panel;
}

void f_节点重置_外部纹理集(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板插座重构(panel, node, E_节点区类型::e_节点区_物体);
	panel->m_属性面板参数构建 = f_外部纹理集节点_部件构建属性;
	panel->m_ICO = "ico平面网格0016";
}




static void f_渐变纹理节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_渐变纹理节点* 节点 = dynamic_cast<C_渐变纹理节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	节点->m_类型.m_UI->m_Update = on_节点参数更新;
	props.push_back(节点->m_类型);
	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_渐变纹理(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_渐变纹理节点(*S_框架::g_3D视口环境);
		node->m_ICO = "ico平面网格0016";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_渐变纹理(panel, node);
	return panel;
}

void f_节点重置_渐变纹理(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_物体);

	panel->m_属性面板参数构建 = f_渐变纹理节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = node->m_ICO;
}



static void f_棋盘格纹理节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_棋盘格纹理节点* 节点 = dynamic_cast<C_棋盘格纹理节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_棋盘格纹理(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_棋盘格纹理节点(*S_框架::g_3D视口环境);
		node->m_ICO = "ico_平面UV0001";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_棋盘格纹理(panel, node);
	return panel;
}

void f_节点重置_棋盘格纹理(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板插座重构(panel, node, E_节点区类型::e_节点区_物体);
	panel->m_属性面板参数构建 = f_棋盘格纹理节点_部件构建属性;
	panel->m_ICO = node->m_ICO;
}



static void f_字符纹理节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_字符纹理节点* 节点 = dynamic_cast<C_字符纹理节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	//auto& p = f_prop_MapPrt(节点->m_字符纹理表);
	//p.mf_元素变更 = on_字符纹理列表_项改变;

	节点->m_字体文件.m_UI->m_Update = on_节点参数更新_重新加载字体;
	//节点->m_字体文件.m_UI->m_Update = on_节点参数更新;
	props.push_back(节点->m_字体文件);

	节点->m_预设字符类型.m_UI->m_Update = on_节点参数更新_重新编译;
	props.push_back(节点->m_预设字符类型);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_字符纹理(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_字符纹理节点(*S_框架::g_3D视口环境);
		node->m_ICO = "0空";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_字符纹理(panel, node);
	return panel;
}

void f_节点重置_字符纹理(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板插座重构(panel, node, E_节点区类型::e_节点区_物体);
	panel->m_属性面板参数构建 = f_字符纹理节点_部件构建属性;
	panel->m_ICO = node->m_ICO;
}



static void f_字符纹理坐标节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_字符纹理坐标节点* 节点 = dynamic_cast<C_字符纹理坐标节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	节点->m_坐标类型.m_UI->m_Update = on_节点参数更新_重新编译;
	props.push_back(节点->m_坐标类型);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_字符纹理坐标(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_字符纹理坐标节点(*S_框架::g_3D视口环境);
		node->m_ICO = "0空";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_字符纹理坐标(panel, node);
	return panel;
}

void f_节点重置_字符纹理坐标(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板插座重构(panel, node, E_节点区类型::e_节点区_物体);
	panel->m_属性面板参数构建 = f_字符纹理坐标节点_部件构建属性;
	panel->m_ICO = node->m_ICO;
}




static void f_字符纹理排列节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_字符纹理排列节点* 节点 = dynamic_cast<C_字符纹理排列节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	//节点->m_坐标类型.m_UI->m_Update = on_节点参数更新_重新编译;
	//props.push_back(节点->m_坐标类型);
	节点->m_上下偏移.m_UI->m_Update = on_节点参数更新;
	props.push_back(节点->m_上下偏移);
	节点->m_间隔.m_UI->m_Update = on_节点参数更新;
	props.push_back(节点->m_间隔);
	节点->m_缩放.m_UI->m_Update = on_节点参数更新;
	props.push_back(节点->m_缩放);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_字符纹理排列(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_字符纹理排列节点(*S_框架::g_3D视口环境);
		node->m_ICO = "0空";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_字符纹理排列(panel, node);
	return panel;
}

void f_节点重置_字符纹理排列(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板插座重构(panel, node, E_节点区类型::e_节点区_物体);
	panel->m_属性面板参数构建 = f_字符纹理排列节点_部件构建属性;
	panel->m_ICO = node->m_ICO;
}




static void f_噪波纹理属性节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_噪波纹理节点* 网格节点 = dynamic_cast<C_噪波纹理节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	props.push_back(网格节点->m_过程纹理属性);
	网格节点->m_通道数量.m_UI->m_Update = on_节点参数更新;
	props.push_back(网格节点->m_通道数量);
	网格节点->m_偏移.m_UI->m_Update = on_噪波节点参数更新;
	props.push_back(网格节点->m_偏移);
	网格节点->m_缩放.m_UI->m_Update = on_噪波节点参数更新;
	props.push_back(网格节点->m_缩放);
	网格节点->m_强度.m_UI->m_Update = on_噪波节点参数更新;
	props.push_back(网格节点->m_强度);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_噪波纹理属性(S_UI创建环境& ctx, S_设备环境& dev_ctx, C_节点基类* node, C_节点树* tree) {
	if (!node) node = new C_噪波纹理节点(*S_框架::g_3D视口环境);
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_噪波纹理属性(panel, node);
	return panel;
}

void f_节点重置_噪波纹理属性(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_物体);

	panel->m_属性面板参数构建 = f_噪波纹理属性节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = "ico平面网格0016";
}




static void f_2D纹理采样节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_2D纹理采样节点* 纹理采样节点 = dynamic_cast<C_2D纹理采样节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	纹理采样节点->m_投影方式.m_UI->m_Update = on_节点参数更新;
	props.push_back(纹理采样节点->m_投影方式);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_2D纹理采样(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) node = new C_2D纹理采样节点(*S_框架::g_3D视口环境);
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_2D纹理采样(panel, node);
	return panel;
}

void f_节点重置_2D纹理采样(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_物体);

	panel->m_属性面板参数构建 = f_2D纹理采样节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = "ico平面网格0016";
}




static void f_2D纹理数组采样节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_2D纹理数组采样节点* 纹理采样节点 = dynamic_cast<C_2D纹理数组采样节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	纹理采样节点->m_采样方式.m_UI->m_Update = on_节点参数更新_重新编译;
	props.push_back(纹理采样节点->m_采样方式);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_2D纹理数组采样(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_2D纹理数组采样节点(ctx_3d);
		node->m_ICO = "0空";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_2D纹理数组采样(panel, node);
	return panel;
}

void f_节点重置_2D纹理数组采样(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板插座重构(panel, node, E_节点区类型::e_节点区_物体);
	panel->m_属性面板参数构建 = f_2D纹理数组采样节点_部件构建属性;
	panel->m_ICO = node->m_ICO;
}




static void f_设置物体材质节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_设置物体材质节点* 网格节点 = dynamic_cast<C_设置物体材质节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_设置物体材质(S_UI创建环境& ctx, S_设备环境& dev_ctx, C_节点基类* node, C_节点树* tree) {
	if (!node) node = new C_设置物体材质节点(*S_框架::g_3D视口环境);
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_设置物体材质(panel, node);
	return panel;
}

void f_节点重置_设置物体材质(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_物体);

	panel->m_属性面板参数构建 = f_设置物体材质节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = "ico平面网格0016";
}




static void f_设置PBR材质属性节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_PBR材着色器节点* 着色器节点 = dynamic_cast<C_PBR材着色器节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	auto* t = 着色器节点->f_get子集树();
	t->m_外部加载.m_UI->m_Update = on_节点参数更新;
	props.push_back(t->m_外部加载);

	if (f_prop_Bool(t->m_外部加载)) {
		t->m_代码文件路径.m_UI->m_Update = on_节点参数更新_重新加载着色器;
		props.push_back(t->m_代码文件路径);
	}

	auto& p = f_prop_MapPrt(着色器节点->m_节点树);
	p.mf_元素变更 = on_PBR着色器节点树列表_项改变;

	props.push_back(着色器节点->m_节点树);
	props.push_back(t->m_函数名称);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_设置PBR材质属性(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) node = new C_PBR材着色器节点(ctx_3d, tree);
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_设置PBR材质属性(panel, node);

	if (!tree) {
		panel->m_同子集节点树关联UI部件 = new std::set<C_Widget*>();
		(*panel->m_同子集节点树关联UI部件).insert(panel);
	}

	return panel;
}

void f_节点重置_设置PBR材质属性(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_物体);

	panel->m_属性面板参数构建 = f_设置PBR材质属性节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = "ico平面网格0016";
}





static void f_基于物理计算着色节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_基于物理计算着色节点* 着色器节点 = dynamic_cast<C_基于物理计算着色节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	着色器节点->m_外部加载.m_UI->m_Update = on_节点参数更新;
	props.push_back(着色器节点->m_外部加载);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_基于物理计算着色(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) node = new C_基于物理计算着色节点(ctx_3d);
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_基于物理计算着色(panel, node);
	return panel;
}

void f_节点重置_基于物理计算着色(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_物体);

	panel->m_属性面板参数构建 = f_基于物理计算着色节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = "ico平面网格0016";
}




static void f_几何数据节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_几何数据节点* 着色器节点 = dynamic_cast<C_几何数据节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_几何数据(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) node = new C_几何数据节点(ctx_3d);
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_几何数据(panel, node);
	return panel;
}

void f_节点重置_几何数据(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_物体);

	panel->m_属性面板参数构建 = f_几何数据节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = "ico平面网格0016";
}



static void f_光线数据节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_光线数据节点* 着色器节点 = dynamic_cast<C_光线数据节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_光线数据(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) node = new C_光线数据节点(ctx_3d);
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_光线数据(panel, node);
	return panel;
}

void f_节点重置_光线数据(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_物体);

	panel->m_属性面板参数构建 = f_光线数据节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = "ico平面网格0016";
}



static void f_几何UV数据节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_几何UV数据节点* node = dynamic_cast<C_几何UV数据节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	node->m_UV类型.m_UI->m_Update = on_节点参数更新;
	props.push_back(node->m_UV类型);
	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_几何UV数据(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_几何UV数据节点(ctx_3d);
		node->m_ICO = "ico平面网格0016";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_几何UV数据(panel, node);
	return panel;
}

void f_节点重置_几何UV数据(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板重构(panel, node, E_节点区类型::e_节点区_物体);
	f_节点重构_插座重构(panel, node, E_节点区类型::e_节点区_物体);

	panel->m_属性面板参数构建 = f_几何UV数据节点_部件构建属性;
	panel->m_3D视口更新 = nullptr;
	panel->m_ICO = node->m_ICO;
}



static void f_材质网格自定义属性数据节点_部件构建属性(C_属性栏* panel, S_结构对象指针 obj) {
	C_材质网格自定义属性数据节点* node = dynamic_cast<C_材质网格自定义属性数据节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	node->m_分布类型.m_UI->m_Update = on_节点参数更新_重新编译;
	props.push_back(node->m_分布类型);
	node->m_属性名称.m_UI->m_Update = on_节点参数更新_重新编译;
	props.push_back(node->m_属性名称);

	node->m_属性类型.m_UI->m_Update = on_节点参数更新_重新编译;
	props.push_back(node->m_属性类型);

	panel->f_构建属性部件(props);
}

C_节点面板* f_节点构建_材质网格自定义属性数据(S_UI创建环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree) {
	if (!node) {
		node = new C_材质网格自定义属性数据节点(ctx_3d);
		node->m_ICO = "0空";
	}
	C_节点面板* panel = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_材质网格自定义属性数据(panel, node);
	return panel;
}

void f_节点重置_材质网格自定义属性数据(C_节点面板* panel, C_节点基类* node) {
	f_节点重构_面板插座重构(panel, node, E_节点区类型::e_节点区_物体);
	panel->m_属性面板参数构建 = f_材质网格自定义属性数据节点_部件构建属性;
	panel->m_ICO = node->m_ICO;
}



void f_节点构建_设置外部文件节点参数(C_节点面板* panel, const std::string& path) {
	C_外部纹理节点* node = dynamic_cast<C_外部纹理节点*>(panel->m_NodeData);

	auto& 路径 = *DEF_路径插座数据(node->f_get输入插座(1), 0);
	路径 = path;
}





